#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	int x = 1;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			printf("%02d", x++);
		}
		printf("\n");
	}
	printf("\n");
	x = 1;
	for (int i = 0; i < n; i++)
	{
		int j = 0;
		for (j = 0; j < n - i - 1; j++)
		{
			printf("  ");
		}
		for (; j < n; j++)
		{
			printf("%02d", x++);
		}
		printf("\n");
	}
	return 0;
}